package ru.ifmo.filemanager.filesystem;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import ru.ifmo.filemanager.filesystem.interfaces.FileSystemObject;

class RootDirectory extends AbstractVirtualDirectory {

	static Map<String, FileSystemObject> roots = new HashMap<String, FileSystemObject>();

	public String[] list() throws IOException {
		synchronized (roots) {
			return roots.keySet().toArray(new String[roots.size()]);
		}
	}

	public FileSystemObject lookup(String name) throws IOException {
		synchronized (roots) {
			return roots.get(name);
		}
	}

	@Override
	public String getName() {
		//throw new NotImplementedException();
		return null;
	}

}